<!DOCTYPE html>
<html lang="zh-cn">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <meta name="renderer" content="webkit">
  <title></title>
  <link rel="stylesheet" href="/public/admin/css/pintuer.css">
  <link rel="stylesheet" href="/public/admin/css/admin.css">
  <script src="/public/admin/js/jquery.js"></script>
  <script src="/public/admin/js/pintuer.js"></script>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.config.js"></script>
  <script type="text/javascript" charset="utf-8" src="/public/baidu/ueditor.all.min.js"> </script>
  <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
  <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
  <script type="text/javascript" charset="utf-8" src="/public/baidu/lang/zh-cn/zh-cn.js"></script>
</head>

<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong><span class="icon-key"></span> 添加新闻</strong></div>
    <div class="body-content">

      <form method="post" class="form-x" action="" enctype="multipart/form-data">

        <div class="form-group">
          <div class="label">
            <label for="sitename">文章标题：</label>
          </div>
          <div class="field">
            <input type="text" class="input " id="" name="title" value="<%= newDate.title%>" size="50"
              placeholder="请输入文章标题" data-validate="required:请输入文章标题" />
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label for="sitename">文章关键字：</label>
          </div>
          <div class="field">
            <input type="text" class="input " id="" name="keywords" value="<%= newDate.keywords%>" size="50"
              placeholder="请输入新闻关键字" data-validate="required:请输入新闻关键字" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label for="sitename">文章描述：</label>
          </div>
          <div class="field">
            <input type="text" class="input " id="" name="description" value="<%= newDate.description%>" size="50"
              placeholder="请输入新闻描述" data-validate="required:请输入新闻描述" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label for="sitename">文章简介：</label>
          </div>
          <div class="field">
            <input type="text" class="input " id="" name="info" value="<%= newDate.info%>" size="50"
              placeholder="请输入新闻简介" data-validate="required:请输入新闻简介" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label for="sitename">文章作者：</label>
          </div>
          <div class="field">
            <input type="text" class="input " id="" name="author" value="<%= newDate.author%>" size="50"
              placeholder="请输入新闻作者" data-validate="required:请输入新闻作者" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label for="sitename">文章分类：</label>
          </div>
          <div class="field">
            <select name="cid" id="" class="input">
              <% data.forEach(item=>{%>
              <% if(item.id == newDate.cid){ %>
              <option selected value="<%= item.id%>"><%= item.name%></option>
              <% }else{ %>
              <option value="<%= item.id%>"><%= item.name%></option>
              <% } %>
              <% }) %>
            </select>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label for="sitename">文章封面：</label>
          </div>
          <div class="field">
            <input type="file" class="input " id="" name="img" size="50"  />
            <img style="width: 200px; box-shadow: 0 0 10px rgba(25,25,25); margin-top: 15px;" src="<%= newDate.img%>"
              alt="">
            <input type="hidden" name="id" value="<%= newDate.id%>">
            <input type="hidden" name="oldimg" value="<%= newDate.img%>">
            </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label for="sitename">文章内容：</label>
          </div>
          <div class="field">
            <!-- 引入ueditor编辑器 -->
            <script id="editor" type="text/plain" name="text"
              style="width:100%;height:500px;"><%- newDate.text%></script>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label></label>
          </div>
          <div class="field">
            <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
          </div>
        </div>
      </form>
    </div>
  </div>
  <script>
    var ue = UE.getEditor('editor');
  </script>
</body>

</html>